<template>
    <div>
        <section class="top">
            <van-row>
                <van-col span="20">
                    <span>公告</span>
                </van-col>
                <van-col span="4">
                    <van-button round size="mini" @click="getTemp(noticeClass)">选择</van-button>
                </van-col>
            </van-row>
            <notice-temp :tempEngine="noticeClass" />
        </section>
    </div>
</template>
<script>
import noticeTemp from '@/components/temp/notice'
import { notice } from './ready'

export default {
    data() {
        return {
            noticeClass: notice
        }
    },
    components: {
        noticeTemp
    },
    methods: {
        async getTemp(cls) {
            await this.$store.dispatch('setIsEdit', true)
            await this.$store.dispatch('setCacheTemp', cls)
            this.$router.replace('/workDesk')
        }
    }
}
</script>
<style lang="scss" scoped>
.top {
    margin-top: 50px;
}

span{
    font-size: 14px;
    color: #606266;
}

section {
    margin: 10px 0;
    box-shadow: 0 2px 2px #DCDFE6;
    border: 1px solid #EBEEF5;
}

.van-button {
    background-color: #409EFF;
    border: 1px solid #409EFF;
    color: #FFF;
}
</style>